Skip to content

enh(python): Add support for Python 3.15 lazy import syntax#4398

Merged
joshgoebel merged 6 commits into
highlightjs:mainfrom
ZeroIntensity:python-lazy-imports
Jul 6, 2026
Merged

enh(python): Add support for Python 3.15 lazy import syntax#4398
joshgoebel merged 6 commits into
highlightjs:mainfrom
ZeroIntensity:python-lazy-imports

Conversation

@ZeroIntensity

Copy link
Copy Markdown
Contributor

Changes

Support for lazy import/lazy from ... import ... in Python 3.15+. See PEP 810 for the specification.

Add lazy to the reserved names list to highlight it as a keyword. It is worth noting that this will also highlight cases where lazy is not an actual keyword (such as lazy = 42), but this seems to be the case for soft keywords already (match = 42 is also highlighted, for example).

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md

@ZeroIntensity

Copy link
Copy Markdown
Contributor Author

cc @joshgoebel

@ZeroIntensity

Copy link
Copy Markdown
Contributor Author

@allejo, are you around for a review?

@joshgoebel

Copy link
Copy Markdown
Member

Please rebase.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

7 files changed

Total change -14 B

View Changes
file base pr diff
es/core.min.js 8.19 KB 8.19 KB -1 B
es/highlight.min.js 8.19 KB 8.19 KB -1 B
es/languages/go.min.js 801 B 794 B -7 B
es/languages/python.min.js 1.58 KB 1.58 KB +2 B
highlight.min.js 8.23 KB 8.23 KB -1 B
languages/go.min.js 808 B 800 B -8 B
languages/python.min.js 1.58 KB 1.59 KB +2 B

@joshgoebel

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

@joshgoebel joshgoebel closed this Jul 5, 2026
@joshgoebel joshgoebel reopened this Jul 5, 2026
@joshgoebel

Copy link
Copy Markdown
Member

It needs to be rebased (not merged) and the conflcits with CHANGELOG reconciled.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

2 files changed

Total change +4 B

View Changes
file base pr diff
es/languages/python.min.js 1.58 KB 1.58 KB +2 B
languages/python.min.js 1.58 KB 1.59 KB +2 B

@joshgoebel joshgoebel merged commit 40fc89e into highlightjs:main Jul 6, 2026
19 checks passed
@ZeroIntensity ZeroIntensity deleted the python-lazy-imports branch July 6, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants